import { defineStore, acceptHMRUpdate } from 'pinia'
import type { Row, Columns } from './index'

export const useMainStore = defineStore('main', {
  state: () => {
    return {
      columns: [
        {
          title: '文件路径',
          key: 'filePath',
          display: true,
        },
        {
          title: '文件名称',
          key: 'fileName',
          display: true,
          width: 260,
        },
        {
          title: '音频状态',
          key: 'audio',
          display: true,
          titleAlign: 'center',
          width: 90,
        },
        {
          title: '操作',
          key: 'active',
          display: true,
          readOnly: false,
          titleAlign: 'center',
          width: 70,
        }
      ] as Columns<Row>
    }
  }
})


// 确保传递正确的 store 声明
if (import.meta.hot) {
  import.meta.hot.accept(acceptHMRUpdate(useMainStore, import.meta.hot))
}
